import { createRouter, createWebHistory } from 'vue-router'
import routes from './routers'

const router = createRouter({
  history: createWebHistory(),
  routes,
})

// //路由守卫
// router.beforeEach((to, from, next) => {
//   if (to.path === '/') {
//     next()
//   } else {
//     const token = localStorage.getItem('token')
//     if (token) {
//       next()
//     } else {
//       next('/')
//     }
//   }
// })
export default router

